<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./jQuery-min.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        
        img {
            display: block;
        }
        
        ul {
            list-style: none;
        }
        
         :root,
        body {
            width: 100%;
            height: 100%;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        
        .king {
            height: 200px;
            width: 852px;
            margin: 100px auto;
            /* background: url(images/bg.png) no-repeat; */
            overflow: hidden;
            padding: 10px;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        
        .king ul {
            width: 600px;
            overflow: hidden;
        }
        
        .king li {
            position: relative;
            float: left;
            width: 50px;
            height: 50px;
            margin-right: 10px;
        }
        
        .king li.current {
            width: 224px;
        }
        
        .king li.current .big {
            display: block;
        }
        
        .king li.current .small {
            display: none;
        }
        
        .big {
            width: 224px;
            display: none;
        }
        
        .small {
            position: absolute;
            top: 0;
            left: 0;
            width: 50px;
            height: 50px;
            border-radius: 5px;
        }
    </style>
</head>

<body>
    <div class="king">
        <ul>
            <li class="current">
                <a href="#">
                    <img src="./lol手风琴案例/01.png" alt="" class="small">
                    <img src="./lol手风琴案例/a.png" alt="" class="big">
                </a>
            </li>
            <li>
                <a href="#">
                    <img src="./lol手风琴案例/02.png" alt="" class="small">
                    <img src="./lol手风琴案例/b.png" alt="" class="big">
                </a>
            </li>
            <li>
                <a href="#">
                    <img src="./lol手风琴案例/03.png" alt="" class="small">
                    <img src="./lol手风琴案例/c.png" alt="" class="big">
                </a>
            </li>
            <li>
                <a href="#">
                    <img src="./lol手风琴案例/04.png" alt="" class="small">
                    <img src="./lol手风琴案例/d.png" alt="" class="big">
                </a>
            </li>
        </ul>
    </div>
    <script>
        $(function() {
            // 鼠标经过某个li 两步操作
            $('.king li').mouseenter(function() {
                // 1.当前li宽度变为224px 同时里面的图片淡出 大图片淡入
                $(this).stop().animate({
                    width: 224
                }).find('.small').stop().fadeOut().siblings('.big').fadeIn();

                // 2.其余兄弟小li宽度变为50px 小图片淡入 大图片淡出
                $(this).siblings('li').stop().animate({
                    width: 50
                }).find('.small').stop().fadeIn().siblings('.big').fadeOut();
            })


        })
    </script>
</body>

</html>